<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>MongoDB driver</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.db2-tables.html">« db2_tables</a></li>
      <li style="float: right;"><a href="mongodb.setup.html">安装/配置 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="refs.database.vendors.html">针对各数据库系统对应的扩展</a></li>
    <li>MongoDB driver</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="set.mongodb" class="set">
 <h1 class="title">MongoDB driver</h1>
 

 <div class="info">
  <div class="abstract">
   <p class="simpara">
    This extension is developed atop the
    <a href="https://github.com/mongodb/mongo-c-driver" class="link external">&raquo;&nbsp;libmongoc</a> and
    <a href="https://github.com/mongodb/mongo-c-driver/tree/master/src/libbson" class="link external">&raquo;&nbsp;libbson</a> libraries.
    It provides a minimal API for core driver functionality:
    <a href="class.mongodb-driver-command.html" class="link">commands</a>,
    <a href="class.mongodb-driver-query.html" class="link">queries</a>,
    <a href="class.mongodb-driver-bulkwrite.html" class="link">writes</a>,
    <a href="class.mongodb-driver-manager.html" class="link">connection management</a>,
    and <a href="book.bson.html" class="link">BSON serialization</a>.
   </p>
   <p class="simpara">
    Userland PHP libraries that depend on this extension may provide higher
    level APIs, such as query builders, individual command helper methods, and
    GridFS. Application developers should consider using this extension in
    conjunction with the
    <a href="https://github.com/mongodb/mongo-php-library" class="link external">&raquo;&nbsp;MongoDB PHP library</a>, which
    implements the same higher level APIs found in MongoDB drivers for other
    languages. This separation of concerns allows the driver to focus on
    essential features for which an extension implementation is paramount for
    performance.
   </p>
  </div>
 </div>

  






  


 




  






  








  




 


  


 


  


 


  




 


<ul class="chunklist chunklist_set"><li><a href="mongodb.setup.html">安装/配置</a><ul class="chunklist chunklist_set chunklist_children"><li><a href="mongodb.requirements.html">需求</a></li><li><a href="mongodb.installation.html">安装</a></li><li><a href="mongodb.configuration.html">运行时配置</a></li><li><a href="mongodb.constants.html">预定义常量</a></li></ul></li><li><a href="mongodb.tutorial.html">Tutorials</a><ul class="chunklist chunklist_set chunklist_children"><li><a href="mongodb.tutorial.library.html">Using the PHP Library for MongoDB (PHPLIB)</a></li><li><a href="mongodb.tutorial.apm.html">Application Performance Monitoring (APM)</a></li></ul></li><li><a href="mongodb.architecture.html">Driver Architecture and Internals</a> — Explains the driver architecture, and special features<ul class="chunklist chunklist_set chunklist_children"><li><a href="mongodb.overview.html">Architecture</a> — Architecture Overview</li><li><a href="mongodb.connection-handling.html">Connections</a> — Connection handling and persistence</li><li><a href="mongodb.persistence.html">Persisting Data</a> — Serialization and deserialization of PHP variables into MongoDB</li></ul></li><li><a href="mongodb.security.html">Security</a><ul class="chunklist chunklist_set chunklist_children"><li><a href="mongodb.security.request_injection.html">Request Injection Attacks</a></li><li><a href="mongodb.security.script_injection.html">Script Injection Attacks</a></li></ul></li><li><a href="book.mongodb.html">MongoDB\Driver</a> — MongoDB 驱动类<ul class="chunklist chunklist_set chunklist_children"><li><a href="class.mongodb-driver-manager.html">MongoDB\Driver\Manager</a> — The MongoDB\Driver\Manager class</li><li><a href="class.mongodb-driver-command.html">MongoDB\Driver\Command</a> — The MongoDB\Driver\Command class</li><li><a href="class.mongodb-driver-query.html">MongoDB\Driver\Query</a> — The MongoDB\Driver\Query class</li><li><a href="class.mongodb-driver-bulkwrite.html">MongoDB\Driver\BulkWrite</a> — The MongoDB\Driver\BulkWrite class</li><li><a href="class.mongodb-driver-writeconcern.html">MongoDB\Driver\WriteConcern</a> — The MongoDB\Driver\WriteConcern class</li><li><a href="class.mongodb-driver-readpreference.html">MongoDB\Driver\ReadPreference</a> — The MongoDB\Driver\ReadPreference class</li><li><a href="class.mongodb-driver-readconcern.html">MongoDB\Driver\ReadConcern</a> — The MongoDB\Driver\ReadConcern class</li><li><a href="class.mongodb-driver-cursor.html">MongoDB\Driver\Cursor</a> — The MongoDB\Driver\Cursor class</li><li><a href="class.mongodb-driver-cursorid.html">MongoDB\Driver\CursorId</a> — The MongoDB\Driver\CursorId class</li><li><a href="class.mongodb-driver-server.html">MongoDB\Driver\Server</a> — The MongoDB\Driver\Server class</li><li><a href="class.mongodb-driver-writeconcernerror.html">MongoDB\Driver\WriteConcernError</a> — The MongoDB\Driver\WriteConcernError class</li><li><a href="class.mongodb-driver-writeerror.html">MongoDB\Driver\WriteError</a> — The MongoDB\Driver\WriteError class</li><li><a href="class.mongodb-driver-writeresult.html">MongoDB\Driver\WriteResult</a> — The MongoDB\Driver\WriteResult class</li></ul></li><li><a href="book.bson.html">MongoDB\BSON</a> — BSON type classes and serialization functions<ul class="chunklist chunklist_set chunklist_children"><li><a href="ref.bson.functions.html">函数</a></li><li><a href="class.mongodb-bson-binary.html">MongoDB\BSON\Binary</a> — The MongoDB\BSON\Binary class</li><li><a href="class.mongodb-bson-decimal128.html">MongoDB\BSON\Decimal128</a> — The MongoDB\BSON\Decimal128 class</li><li><a href="class.mongodb-bson-javascript.html">MongoDB\BSON\Javascript</a> — The MongoDB\BSON\Javascript class</li><li><a href="class.mongodb-bson-maxkey.html">MongoDB\BSON\MaxKey</a> — The MongoDB\BSON\MaxKey class</li><li><a href="class.mongodb-bson-minkey.html">MongoDB\BSON\MinKey</a> — The MongoDB\BSON\MinKey class</li><li><a href="class.mongodb-bson-objectid.html">MongoDB\BSON\ObjectId</a> — The MongoDB\BSON\ObjectId class</li><li><a href="class.mongodb-bson-regex.html">MongoDB\BSON\Regex</a> — The MongoDB\BSON\Regex class</li><li><a href="class.mongodb-bson-timestamp.html">MongoDB\BSON\Timestamp</a> — The MongoDB\BSON\Timestamp class</li><li><a href="class.mongodb-bson-utcdatetime.html">MongoDB\BSON\UTCDateTime</a> — The MongoDB\BSON\UTCDateTime class</li><li><a href="class.mongodb-bson-type.html">MongoDB\BSON\Type</a> — The MongoDB\BSON\Type interface</li><li><a href="class.mongodb-bson-persistable.html">MongoDB\BSON\Persistable</a> — The MongoDB\BSON\Persistable interface</li><li><a href="class.mongodb-bson-serializable.html">MongoDB\BSON\Serializable</a> — The MongoDB\BSON\Serializable interface</li><li><a href="class.mongodb-bson-unserializable.html">MongoDB\BSON\Unserializable</a> — The MongoDB\BSON\Unserializable interface</li><li><a href="class.mongodb-bson-binaryinterface.html">MongoDB\BSON\BinaryInterface</a> — The MongoDB\BSON\BinaryInterface interface</li><li><a href="class.mongodb-bson-decimal128interface.html">MongoDB\BSON\Decimal128Interface</a> — The MongoDB\BSON\Decimal128Interface interface</li><li><a href="class.mongodb-bson-javascriptinterface.html">MongoDB\BSON\JavascriptInterface</a> — The MongoDB\BSON\JavascriptInterface interface</li><li><a href="class.mongodb-bson-maxkeyinterface.html">MongoDB\BSON\MaxKeyInterface</a> — The MongoDB\BSON\MaxKeyInterface interface</li><li><a href="class.mongodb-bson-minkeyinterface.html">MongoDB\BSON\MinKeyInterface</a> — The MongoDB\BSON\MinKeyInterface interface</li><li><a href="class.mongodb-bson-objectidinterface.html">MongoDB\BSON\ObjectIdInterface</a> — The MongoDB\BSON\ObjectIdInterface interface</li><li><a href="class.mongodb-bson-regexinterface.html">MongoDB\BSON\RegexInterface</a> — The MongoDB\BSON\RegexInterface interface</li><li><a href="class.mongodb-bson-timestampinterface.html">MongoDB\BSON\TimestampInterface</a> — The MongoDB\BSON\TimestampInterface interface</li><li><a href="class.mongodb-bson-utcdatetimeinterface.html">MongoDB\BSON\UTCDateTimeInterface</a> — The MongoDB\BSON\UTCDateTimeInterface interface</li><li><a href="class.mongodb-bson-dbpointer.html">MongoDB\BSON\DBPointer</a> — The MongoDB\BSON\DBPointer class (deprecated)</li><li><a href="class.mongodb-bson-int64.html">MongoDB\BSON\Int64</a> — The MongoDB\BSON\Int64 class</li><li><a href="class.mongodb-bson-symbol.html">MongoDB\BSON\Symbol</a> — The MongoDB\BSON\Symbol class (deprecated)</li><li><a href="class.mongodb-bson-undefined.html">MongoDB\BSON\Undefined</a> — The MongoDB\BSON\Undefined class (deprecated)</li></ul></li><li><a href="mongodb.monitoring.html">MongoDB\Driver\Monitoring</a> — Monitoring classes and subscriber functions<ul class="chunklist chunklist_set chunklist_children"><li><a href="ref.monitoring.functions.html">函数</a></li><li><a href="class.mongodb-driver-monitoring-commandfailedevent.html">MongoDB\Driver\Monitoring\CommandFailedEvent</a> — The MongoDB\Driver\Monitoring\CommandFailedEvent class</li><li><a href="class.mongodb-driver-monitoring-commandstartedevent.html">MongoDB\Driver\Monitoring\CommandStartedEvent</a> — The MongoDB\Driver\Monitoring\CommandStartedEvent class</li><li><a href="class.mongodb-driver-monitoring-commandsucceededevent.html">MongoDB\Driver\Monitoring\CommandSucceededEvent</a> — The MongoDB\Driver\Monitoring\CommandSucceededEvent class</li><li><a href="class.mongodb-driver-monitoring-serverchangedevent.html">MongoDB\Driver\Monitoring\ServerChangedEvent</a> — The MongoDB\Driver\Monitoring\ServerChangedEvent class</li><li><a href="class.mongodb-driver-monitoring-serverclosedevent.html">MongoDB\Driver\Monitoring\ServerClosedEvent</a> — The MongoDB\Driver\Monitoring\ServerClosedEvent class</li><li><a href="class.mongodb-driver-monitoring-serveropeningevent.html">MongoDB\Driver\Monitoring\ServerOpeningEvent</a> — The MongoDB\Driver\Monitoring\ServerOpeningEvent class</li><li><a href="class.mongodb-driver-monitoring-serverheartbeatfailedevent.html">MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent</a> — The MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent class</li><li><a href="class.mongodb-driver-monitoring-serverheartbeatstartedevent.html">MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent</a> — The MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent class</li><li><a href="class.mongodb-driver-monitoring-serverheartbeatsucceededevent.html">MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent</a> — The MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent class</li><li><a href="class.mongodb-driver-monitoring-topologychangedevent.html">MongoDB\Driver\Monitoring\TopologyChangedEvent</a> — The MongoDB\Driver\Monitoring\TopologyChangedEvent class</li><li><a href="class.mongodb-driver-monitoring-topologyclosedevent.html">MongoDB\Driver\Monitoring\TopologyClosedEvent</a> — The MongoDB\Driver\Monitoring\TopologyClosedEvent class</li><li><a href="class.mongodb-driver-monitoring-topologyopeningevent.html">MongoDB\Driver\Monitoring\TopologyOpeningEvent</a> — The MongoDB\Driver\Monitoring\TopologyOpeningEvent class</li><li><a href="class.mongodb-driver-monitoring-commandsubscriber.html">MongoDB\Driver\Monitoring\CommandSubscriber</a> — The MongoDB\Driver\Monitoring\CommandSubscriber interface</li><li><a href="class.mongodb-driver-monitoring-sdamsubscriber.html">MongoDB\Driver\Monitoring\SDAMSubscriber</a> — The MongoDB\Driver\Monitoring\SDAMSubscriber interface</li><li><a href="class.mongodb-driver-monitoring-subscriber.html">MongoDB\Driver\Monitoring\Subscriber</a> — The MongoDB\Driver\Monitoring\Subscriber interface</li></ul></li><li><a href="mongodb.exceptions.html">MongoDB\Driver\Exception</a> — Exception 类<ul class="chunklist chunklist_set chunklist_children"><li><a href="class.mongodb-driver-exception-authenticationexception.html">MongoDB\Driver\Exception\AuthenticationException</a> — The MongoDB\Driver\Exception\AuthenticationException class</li><li><a href="class.mongodb-driver-exception-bulkwriteexception.html">MongoDB\Driver\Exception\BulkWriteException</a> — The MongoDB\Driver\Exception\BulkWriteException class</li><li><a href="class.mongodb-driver-exception-connectionexception.html">MongoDB\Driver\Exception\ConnectionException</a> — The MongoDB\Driver\Exception\ConnectionException class</li><li><a href="class.mongodb-driver-exception-connectiontimeoutexception.html">MongoDB\Driver\Exception\ConnectionTimeoutException</a> — The MongoDB\Driver\Exception\ConnectionTimeoutException class</li><li><a href="class.mongodb-driver-exception-exception.html">MongoDB\Driver\Exception\Exception</a> — The MongoDB\Driver\Exception\Exception interface</li><li><a href="class.mongodb-driver-exception-executiontimeoutexception.html">MongoDB\Driver\Exception\ExecutionTimeoutException</a> — The MongoDB\Driver\Exception\ExecutionTimeoutException class</li><li><a href="class.mongodb-driver-exception-invalidargumentexception.html">MongoDB\Driver\Exception\InvalidArgumentException</a> — The MongoDB\Driver\Exception\InvalidArgumentException class</li><li><a href="class.mongodb-driver-exception-logicexception.html">MongoDB\Driver\Exception\LogicException</a> — The MongoDB\Driver\Exception\LogicException class</li><li><a href="class.mongodb-driver-exception-runtimeexception.html">MongoDB\Driver\Exception\RuntimeException</a> — The MongoDB\Driver\Exception\RuntimeException class</li><li><a href="class.mongodb-driver-exception-sslconnectionexception.html">MongoDB\Driver\Exception\SSLConnectionException</a> — The MongoDB\Driver\Exception\SSLConnectionException class (deprecated)</li><li><a href="class.mongodb-driver-exception-unexpectedvalueexception.html">MongoDB\Driver\Exception\UnexpectedValueException</a> — The MongoDB\Driver\Exception\UnexpectedValueException class</li><li><a href="class.mongodb-driver-exception-writeexception.html">MongoDB\Driver\Exception\WriteException</a> — The MongoDB\Driver\Exception\WriteException class</li></ul></li></ul></div></div></div></body></html>